/**
 * Package for Environments area classes.
 */
jsx3.lang.Package.definePackage("tibco.admin.environments", function() {
});

/**
 * Interface to be implemented by all plugin components wishing to create a new tab in the Environments
 * perspective area.
 */
jsx3.lang.Class.defineInterface(
        "tibco.admin.environments.EnvironmentsInterface",
        tibco.admin.plugin.PluginInterface,
        function(plugin) {

            /**
            * {Function} function to be called upoon the completion of the addition of a new node.  Set by the parent
            * plugin container.
            * @private
            */
            plugin.prototype.addCompletedCallback = null;

            /**
            * Unused.  Orphaned field.
            * @private
            */
            plugin.prototype.connectorId = null

            /**
             * Abstract method to be implemented by all implementing classes.  Should return the text that
             * will appear on the button.
             *
             * @return {String} the text to appear on this plugin component's button.
             */
            plugin.prototype.getButtonText = jsx3.lang.Method.newAbstract();

            /**
            * Abstract function to be implemented by the plugin component.<br /><br />
            * Called by the parent plugin container to set the id of the currently selected environment.
            *
            * @param envId {String} the id of the currently selected environment
            */
            plugin.prototype.setEnvId = jsx3.lang.Method.newAbstract("envId");

            /**
            * Abstract function to be implemented by the plugin component.<br /><br />
            * Called by the parent plugin container to set the id(s) of the currently selected node(s).
            *
            * @param arrIds {Array} an array of the (String) ids of the currently selected nodes, or null if no nodes are selected.
            */
            plugin.prototype.setNodeIds = jsx3.lang.Method.newAbstract("arrIds");

            /**
            * Preimplemented function to be called by plugin components upon the completion of an operation that adds (creates) a new node.
            *
            * @param addedNodeId {String} the id of the newly created node.
            */
            plugin.prototype.addCompleted = function(addedNodeId) {
                try {
                    this.addCompletedCallback.call(this.callbackTarget, addedNodeId);
                }
                catch(ex) {
                    tibco.admin.Main.logException(ex);
                }
            }

            /**
            * Preimplemented as an empty function for backwards compatibility.  Called by the parent plugin container to
            * set the name of the SINGLE currently selected node.
            *
            * @param nodeName {String} the name of the SINGLE currently selected node, or <code>null</code> if there are no nodes or
            *                          multiple nodes selected.
            */
            plugin.prototype.setNodeName = function(nodeName) {
            }

            /**
             * Preimplemented as an empty function for backwards compatibility.  Called by the parent plugin container to
             * set the status of the SINGLE currently selected node.
             *
             * @param state {String} the status of the SINGLE currently selected node, or <code>null</code> if there are no nodes or
             *                          multiple nodes selected.
             */
            plugin.prototype.setNodeState = function(state) {
            }

            /**
             * Preimplemented as an empty function for backwards compatibility.  Called by the parent plugin container to
             * trigger the creation of a new node.  Only used by the General Details plugin component.
             *
             * @private
             */
            plugin.prototype.newNode = function() {
            }

            /**
            * Preimplemented as an empty function for backwards compatibility.  Called by the parent plugin container to
            * indicate that this plugin component's button has been selected.  Should be overridden by the plugin component
            * to handle refreshes of data on button selection.
            */
            plugin.prototype.buttonSelected = function() {
            }
        }
        );